package com.example.springboot.pojo;

import java.util.Objects;
/**
 * 消息实体类
 */
public class NewsPO {
    private Integer id;
    private String title;
    private String content;
    public NewsPO() {
    }
    public NewsPO(Integer id, String title, String content) {
        this.id = id;
        this.title = title;
        this.content = content;
    }
    public Integer getId() {
        return id;
    }
    public void setId(Integer id) {
        this.id = id;
    }
    public String getTitle() {
        return title;
    }
    public void setTitle(String title) {
        this.title = title;
    }
    public String getContent() {
        return content;
    }
    public void setContent(String content) {
        this.content = content;
    }
    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        NewsPO newsPO = (NewsPO) o;
        return Objects.equals(id, newsPO.id) && Objects.equals(title, newsPO.title)
                && Objects.equals(content, newsPO.content);
    }
    @Override
    public int hashCode() {
        return Objects.hash(id, title, content);
    }
    @Override
    public String toString() {
        return "NewsPO{" +
                "id=" + id +
                ", title='" + title + '\'' +
                ", content='" + content + '\'' +
                '}';
    }
    public static NewsPOBuilder builder(){
        return new NewsPOBuilder();
    }
    public static class NewsPOBuilder{
        private Integer id;
        private String title;
        private String content;
        public NewsPOBuilder(){
        }
        public NewsPOBuilder id(Integer id){
            this.id = id;
            return this;
        }
        public NewsPOBuilder title(String title){
            this.title = title;
            return this;
        }
        public NewsPOBuilder content(String content){
            this.content = content;
            return this;
        }
        public NewsPO build(){
            return new NewsPO(this.id, this.title, this.content);
        }
        public String toString() {
            return "NewsPO.NewsPOBuilder(id=" + this.id + ", title=" + this.title +
                    ", content=" + this.content + ")";
        }
    }
}